import NumberTimer from "../utils/number";
import appendNumber from "./appendNumber";

let isStart = true;
const numberTimerInstance = new NumberTimer(100);
numberTimerInstance.onNumberCreated = function (n, isPrime) {
  appendNumber(n, isPrime);
};

numberTimerInstance.start();

window.onclick = function () {
  if (isStart) {
    numberTimerInstance.stop();
    isStart = false;
  } else {
    numberTimerInstance.start();
    isStart = true;
  }
};
